{% extends 'app01/newRow.html' %}
{% block table %}
            <table width="800" border="1" cellpadding="2" cellspacing="1" id="SignFrame" class="table-primary">
            <div>
                <tr id="trHeader" style="font-size: 10px; height: 30px; width: 950px">
                    <td style="background: lightblue; width: 40px;">#</td>
                    <td style="background: lightblue">字段名</td>
                    <td style="background: lightblue">字段类型</td>
                    <td style="background: lightblue">枚举值（文本框也可输入多个）</td>
                    <td style="background: lightblue">符号</td>
                    <td style="background: lightblue">日期</td>
                    <td style="background: lightblue">符号</td>
                    <td style="background: lightblue">时间</td>
                    <td align="center" style="background: lightblue"> </td>
                </tr>
                <tr>
                    <td>1</td>
                    <td><input required class='form-control' style='margin-bottom: 2px; margin-top: 2px; height: 25px;width: 80px;' name='field_name0' id='field_name0' type='text' size='12'></td>
                    <td><select class='form-control' required style='margin-bottom: 2px; margin-top: 2px; height: 25px; width: 100px' name='field_type0' id='field_type0' >" +
                            <option value='文本'>文本</option>
                            <option value='数字'>数字</option>
                            <option value='日期'>日期</option>
                            <option value='时间'>时间</option>
                            <option value='单选'>单选</option>
                            <option value='多选'>多选</option>
                        </select></td>
                    <td><input class='form-control' placeholder='英文逗号分隔（单、多选、文本、数字）' style='margin-bottom: 2px; margin-top: 2px; height: 25px;width: 280px' name='enums0' id='enums0' type='text' size='20' /></td>
                    <td><select class='form-control' required style='margin-bottom: 2px; margin-top: 2px; height: 25px; width: 50px' name='symbol_date0' id='symbol_date0' >" +
                            <option value='小于'>&lt;</option>
                            <option value='大于'>&gt;</option>
                            <option value='小于等于'>&lt;=</option>
                            <option value='大于等于'>&gt;=</option>
                            <option value='等于'>=</option>
                        </select></td>
                    <td><input class='form-control' placeholder="日期" style='margin-bottom: 2px; margin-top: 2px; height: 25px;width: 120px' name='date0' id='date0' type='date' size='20' /></td>
                    <td><select class='form-control' required style='margin-bottom: 2px; margin-top: 2px; height: 25px; width: 50px' name='symbol_time0' id='symbol_time0' >" +
                            <option value='小于'>&lt;</option>
                            <option value='大于'>&gt;</option>
                            <option value='小于等于'>&lt;=</option>
                            <option value='大于等于'>&gt;=</option>
                            <option value='等于'>=</option>
                        </select></td>
                    <td><input class='form-control' placeholder="时间" style='margin-bottom: 2px; margin-top: 2px; height: 25px;width: 170px' name='time0' id='time0' type='datetime-local' size='20' /></td>
                </tr>
            </div>
        </table>

{% endblock %}
{% block add_sign_row %}
    <script>
    function AddSignRow() {
            //读取最后一行的行号，存放在txtTRLastIndex文本框中
            var txtTRLastIndex = findObj("txtTRLastIndex", document);
            var rowID = parseInt(txtTRLastIndex.value);
            var signFrame = findObj("SignFrame", document);
            //添加行
            var newTR = signFrame.insertRow(signFrame.rows.length);
            newTR.id = "SignItem" + rowID;
            //添加列:序号
            var newNameTD = newTR.insertCell(0);
            //添加列内容
            newNameTD.innerHTML = newTR.rowIndex.toString();
            //添加列:字段
            var FieldTD = newTR.insertCell(1);
            //添加列内容
            FieldTD.innerHTML = "<input required class='form-control' style='margin-bottom: 2px; margin-top: 2px; height: 25px; width: 80px' name='field_name" + rowID + "' id='field_name" + rowID + "' type='text' size='12' />";
            //添加列:类型
            var newTypeTD = newTR.insertCell(2);
            newTypeTD.innerHTML = "<select class='form-control' required style='margin-bottom: 2px; margin-top: 2px; height: 25px; width: 100px' name='field_type" + rowID + "' id='field_type" + rowID + "' >" +
                "<option value='文本'>文本</option>" +
                "<option value='数字'>数字</option>" +
                "<option value='日期'>日期</option>" +
                "<option value='时间'>时间</option>" +
                "<option value='单选'>单选</option>" +
                "<option value='多选'>多选</option>" +
                {#"<option value='下拉'>下拉</option>" +#}
                "</select>";
            //添加列:枚举
            var newEnumTD = newTR.insertCell(3);
            //添加列内容
            newEnumTD.innerHTML = "<input class='form-control' placeholder='英文逗号分隔（单、多选、文本、数字）' style='margin-bottom: 2px; margin-top: 2px; height: 25px;width: 280px' name='enums" + rowID + "' id='enums" + rowID + "' type='text' size='20' />";
             //添加列:日期符号
            var symbolDateTD = newTR.insertCell(4);
            //添加列内容
            symbolDateTD.innerHTML = "<select class='form-control' required style='margin-bottom: 2px; margin-top: 2px; height: 25px; width: 50px' name='symbol_date" + rowID + "' id='symbol_date" + rowID + "' >" +
                "<option value='小于'>&lt;</option>" +
                "<option value='大于'>&gt;</option>" +
                "<option value='小于等于'>&lt;=</option>" +
                "<option value='大于等于'>&gt;=</option>" +
                "<option value='等于'>=</option>" +
                "</select>";
             //添加列:日期
            var newDateTD = newTR.insertCell(5);
            //添加列内容
            newDateTD.innerHTML = "<input class='form-control' placeholder=\"日期\" style='margin-bottom: 2px; margin-top: 2px; height: 25px;width: 120px' name='date" + rowID + "' id='date" + rowID + "' type='date' size='20' />";
            //添加列:时间符号
            var symbolTimeTD = newTR.insertCell(6);
            //添加列内容
            symbolTimeTD.innerHTML =  "<select class='form-control' required style='margin-bottom: 2px; margin-top: 2px; height: 25px; width: 50px' name='symbol_time" + rowID + "' id='symbol_time" + rowID + "' >" +
                "<option value='小于'>&lt;</option>" +
                "<option value='大于'>&gt;</option>" +
                "<option value='小于等于'>&lt;=</option>" +
                "<option value='大于等于'>&gt;=</option>" +
                "<option value='等于'>=</option>" +
                "</select>";

             //添加列:时间
            var newTimeTD = newTR.insertCell(7);
            //添加列内容
            newTimeTD.innerHTML = "<input class='form-control' placeholder=\"时间\" style='margin-bottom: 2px; margin-top: 2px; height: 25px;width: 170px' name='time" + rowID + "' id='time" + rowID + "' type='datetime-local' size='20' />";
            //添加列:删除按钮
            var newDeleteTD = newTR.insertCell(8);
            //添加列内容
            newDeleteTD.innerHTML = "<div align='center' style='width:40px; font-size: 13px'><a href='javascript:;' onclick=\"DeleteSignRow('SignItem" + rowID + "')\">删除</a></div>";
            txtTRLastIndex.value = (rowID + 1).toString();
        }
    </script>
{% endblock %}
{% block submit_url %}{% url 'app01:search_page_new_row' %}{% endblock %}
{% block generate_url %}{% url 'app01:search_page_generate_case_by_ai' %}{% endblock %}
